{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-education.tpl"}</nav>
    <article class="right-col"><h2><a href="{$smarty.const.HOST_BACKEND}product/index">Sản phẩm</a> &raquo; Thêm mới</h2>
                    
        <form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}product/save" class="ui">
            <input type="hidden" name="ptbfeature" id="ptbfeature" />
            <input type="hidden" name="pcontent" id="pcontent" />
            <ul>
                {if isset($smarty.session.PRODUCT_ERROR)}
                    <li class="error">
                       {include file="common/error.tpl" dataSession=$smarty.session.PRODUCT_ERROR}    
                    </li>
                {/if}
                {if $arrAlbum}
                    <li>
                        <label for="palbumid">Album sideshow:</label>
                        <select id="palbumid" name="palbumid">
                            <option value="0">--Chọn--</option>
                            {foreach item=item from=$arrAlbum}
                                <option value="{$item.albumid}" {if isset($smarty.session.PRODUCT_POST.palbumid) && $smarty.session.PRODUCT_POST.palbumid==$item.albumid}selected="selected"{/if}>{$item.name} ({$item.timage} hình)</option>
                            {/foreach}
                        </select>
                    </li>
                {/if}                             
                <li>
                    <label for="pcategoryid">Phân loại <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid" onchange="javascript:loadSub(this.value,'psubid');">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.PRODUCT_POST.pcategoryid) && $smarty.session.PRODUCT_POST.pcategoryid==$item.categoryid}selected="selected"{elseif $row.categoryid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                	</div>
                </li>
                <li>
                    <label for="psubid">Phân cấp:</label>
                   	<div class="sel">
                        <select id="psubid" name="psubid">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrSub}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.PRODUCT_POST.pcategoryid) && $smarty.session.PRODUCT_POST.psubid==$item.categoryid}selected="selected"{elseif $row.subid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="pname">Tên sản phẩm <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.PRODUCT_POST.pname)}{$smarty.session.PRODUCT_POST.pname|escape}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}" />
                    </div>
                </li>
                <li>
                    <label for="pimage">Hình sản phẩm <span class="required">*</span>:</label>
                    <div class="txt">
                        <input type="file" class="text" name="pimage" id="pimage" value="" />
                    </div>
                </li>
                <li>
                    <label for="pshort">Tóm lược:</label>
                    <div class="area">
                        <textarea cols="1" rows="1" name="pshort" id="pshort">{$smarty.session.PRODUCT_POST.pshort}</textarea>
                    </div>
                </li>                            
                <li>
                    <label for="pcontent">Giới thiệu đặc tính<span class="required">*</span>:</label>
                    <div class="area">
                        <textarea cols="1" rows="1" name="fckcontent" id="fckcontent">{$smarty.session.PRODUCT_POST.pcontent}</textarea>
                    </div>
                </li>
                <li>
                    <label for="pprice">Giá đề xuất:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pprice" id="pprice" value="{if isset($smarty.session.PRODUCT_POST.pprice)}{$smarty.session.PRODUCT_POST.pprice|escape}{/if}" maxlength="20" />
                    </div>
                </li> 
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.PRODUCT_POST.ptag)}{$smarty.session.PRODUCT_POST.ptag|escape}{/if}" maxlength="{$smarty.const.VL_TAG_MAXLENGTH}" />
                    </div>
                </li>                                                  
                
                <li>
                	<label>Thông tin mở rộng:</label>
                    {include file="common/table-feature.tpl"}
                </li>                                             
                <li>
                    <button type="submit">Lưu dữ liệu</button>
                    <button type="reset">Nhập lại</button>
                </li>
          	</ul>
        </form>
	</article>
</section>                   	
{include file="common/footer.tpl"}
                
